#include <QBrush>
#include <QPalette>

#include "displayLCD.h"

Display::Display(QColor color, QRect rect)
{
    QPalette palette;
    QBrush num_brush(color);
    num_brush.setStyle(Qt::SolidPattern);
    QBrush bg_brush(QColor(0, 0, 0, 255));
    bg_brush.setStyle(Qt::SolidPattern);

    palette.setBrush(QPalette::Active, QPalette::WindowText, num_brush);
    palette.setBrush(QPalette::Active, QPalette::Window, bg_brush);
    palette.setBrush(QPalette::Inactive, QPalette::WindowText, num_brush);
    palette.setBrush(QPalette::Inactive, QPalette::Window, bg_brush);
    palette.setBrush(QPalette::Disabled, QPalette::WindowText, num_brush);
    palette.setBrush(QPalette::Disabled, QPalette::Window, bg_brush);

    setFrameShape(QLCDNumber::NoFrame);
    setGeometry(rect);
    setNumDigits(2);
    setSegmentStyle(QLCDNumber::Flat);
    setAutoFillBackground(true);
    setPalette(palette);
}
